#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<set>
#include<queue>
#include<string>
#include<vector>
#include<ctime>
#include<stack>
#include<sstream>
using namespace std;
int main()
{
    long long a,b,ans,cnt,x,y;
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    while(scanf("%lld%lld",&a,&b)!=EOF)
    {
        x=a*(a+1)/2;
        y=b*(b+1)/2;
        ans=x*y;
        if(a>b)swap(a,b);
        cnt=(b+(b-a+1))*a/2;
        printf("%lld %lld\n",ans,cnt);
    }
    return 0;
}
